<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>蚂蚁君-欢迎加入</title>
    <script src="https://ksc.cdn.tj.asm8.com/WeChatMinApp%2Ftry_play%2FAndroid%2Fgeneralize%2Fflexible.js"></script>
</head>
<body>

    <div class="content_wrap">
        <div class="head_content">
            <div class="head_content_text">
                我是蚂蚁君，想知道什么叫真正的靠谱有趣的社区吗?，快来加入我们吧
            </div>

            <img class="head_content_inset" src="https://ksc.cdn.tj.asm8.com/WeChatMinApp%2Ftry_play%2FAndroid%2Fgeneralize%2Finset_img.png" alt="">
        </div>

        <div class="zhong_content">
            <div>好玩</div>
            <div>有趣的</div>
            <div>App社区</div>
        </div>

        <div class="btn_wrap">
            <div class="btn" onclick="onBtn()">立即加入</div>
        </div>


    </div>

    <div id="modal-mask" class="modal-mask modal-mask-wx-lo" style="display: none;" onclick="coloseModal()">
        <img class="wx-lo-tip" src="https://ksc.cdn.tj.asm8.com/WeChatMinApp%2Ftry_play%2FAndroid%2Fgeneralize%2Flo_android.png" alt="">
    </div>
</body>

<style>
    body{
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .content_wrap{
        width: 10rem;
        height: 100vh;
    }

    .head_content{
        width: 10rem;
        height: 6.5rem;
        background: url("https://ksc.cdn.tj.asm8.com/WeChatMinApp%2Ftry_play%2FAndroid%2Fgeneralize%2Fsky_img.png");
        background-size: cover;
        position: absolute;

    }

    .head_content_text{
        width: 8rem;
        margin-top: 0.6rem;
        margin-left: 0.6rem;
        font-size: 0.4rem;
        color: white;
        font-weight: 300;
    }

    .head_content_inset{
        width: 2.614rem;
        height: 3.466rem;
        position: absolute;
        right: 0;
        top: 2rem;
    }

    .zhong_content{
        margin-top: 7rem;
        margin-left: 1rem;
        font-size: 1rem;
    }

    .btn_wrap{
        width: 10rem;
        display: flex;
        justify-content: center;
    }

    .btn{
        width: 7rem;
        height: 1.3rem;
        border-radius: 10rem;
        background: #fcce2f;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.5rem;
        font-weight: 600;
        color: white;
        position: absolute;
        bottom: 1rem;
    }

    .modal-mask {
        width: 100vw;
        height: 100vh;
        position:fixed;
        top:0;
        left:0;
        right:0;
        background-color: rgba(0,0,0,0.8);;
        overflow: hidden;
        z-index: 9000;
        color: #fff;
    }

    .wx-lo-tip{
        width: 6.5rem;
        position: absolute;
        right: 0.2rem;
    }
</style>

<script>
    function onBtn(){
        if(is_weixn()){
            var modal = document.getElementById('modal-mask');
            modal.style.display = 'block';
        }else{
            var param = getParam()
            var url = "https://zhuan.5dos.com/api/downloadurl/"+param.invite_code+"?device_id=3687542"
            window.location.href = url
        }
    }

    function coloseModal() {
        var modal = document.getElementById('modal-mask');
        modal.style.display = 'none';
    }

    function is_weixn(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;
        }
    }

    function getParam() {
        var url = location.search; //获取url中"?"符后的字串
        console.log("url",url)
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for(var i = 0; i < strs.length; i ++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }

</script>

</html>
